package com.sll.hosptials.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sll.hosptials.controller.req.DictTypePageReq;
import com.sll.hosptials.model.DictType;
import com.sll.hosptials.service.DictTypeService;
import com.sll.hosptials.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "字典类型")
@RequestMapping("/dictType")
@RestController
public class DictTypeController {
    @Resource
    private DictTypeService dictTypeService;

    @ApiOperation("分页")
    @PostMapping("page")
    public Result<Page<DictType>> page(DictTypePageReq req){
        return Result.success(dictTypeService.page(req));
    }

    @ApiOperation("获取所有字典类型列表")
    @PostMapping("listAll")
    public Result<List<DictType>> list(){
        return Result.success(dictTypeService.list());
    }






}
